

package com.maoshi.shop.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.bean.app.dto.ShopHeadInfoDto;
import com.maoshi.shop.bean.model.ShopAuditing;
import com.maoshi.shop.bean.model.ShopDetail;
import com.maoshi.shop.bean.dto.ShopDetailParam;
import com.maoshi.shop.bean.param.OfflineHandleEventAuditParam;
import com.maoshi.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @author lgh on 2018/08/29.
 */
public interface ShopDetailService extends IService<ShopDetail> {

	void updateShopDetail(ShopDetail shopDetail,ShopDetail dbShopDetail);

	void deleteShopDetailByShopId(Long id);

	/**
	 * 根据店铺id获取店铺信息
	 * @param shopId
	 * @return
	 */
	ShopDetail getShopDetailByShopId(Long shopId);

	void removeShopDetailCacheByShopId(Long shopId);

	/**
	 * 根据店铺的手机号（登陆账号），获取店铺信息
	 *
	 * @param mobile 手机号
	 * @return
	 */
	ShopDetail getShopByMobile(@Param("mobile") String mobile);

	void updatePasswordByUserName(String username, String newPassword);

	/**
	 * 根据用户id查询店铺信息
	 */
	ShopDetail getShopDetailByUserId(String userId);

	/**
	 * 申请开店铺
	 */
	void applyShop(String userId, ShopDetailParam shopDetailParam);

	/**
	 * 审核商家信息
	 */
	boolean audit(ShopAuditing shopAuditing);

	/**
	 *  平台 --下线活动商品
	 */
    void offline(ShopDetail shopDetail, String offlineReason, Long sysUserId);

	/**
	 * 申请审核
	 */
	void auditApply(Long eventId, Long handleId, String reapplyReason);

	/**
	 * 审核下线商店
	 */
	void auditOfflineShop(OfflineHandleEventAuditParam offlineHandleEventAuditParam, Long sysUserId);

	/**
	 * 热门店铺
	 * @return
	 */
    List<ShopHeadInfoDto> listHotShopsHead();

	/**
	 * 分页搜索店铺
	 * @param page
	 * @param shopHeadInfoDto
	 * @return
	 */
    Page<ShopHeadInfoDto> searchShops(PageParam<ShopHeadInfoDto> page, ShopHeadInfoDto shopHeadInfoDto);

	//合并代码开始
	void updateOrderTypeBasket(Integer orderTypeBasket,Long shopId);
	/**
	 * 查找所有店铺
	 * @return
	 */
	List<ShopDetail> getAllShop();

	/**
	 * 是否开启配送服务
	 * @param shopId
	 * @param isDelivery
	 */
	void isDelivery(Long shopId, Integer isDelivery);
	//合并代码结束
}
